#include "SetColor.h"
#include "Arduino.h"

SetColor::SetColor(int R, int G, int B)
{
    this->RPin = R;
    this->GPin = G;
    this->BPin = B;
}

void SetColor::UpdateColor(float pos)
{
    if (pos >= 30.00)
    {
        analogWrite(RPin, 255);
        analogWrite(GPin, 0);
        analogWrite(BPin, 255);
    }
    else if (pos <= 10.00)
    {
        analogWrite(RPin, 0);
        analogWrite(GPin, 255);
        analogWrite(BPin, 255);
    }
    else
    {
        analogWrite(RPin, 0);
        analogWrite(GPin, 0);
        analogWrite(BPin, 255);
    }
}
